import React, { useEffect, useState } from "react";
 
import axios from "axios";
import "./index.css";
const App: React.FC = () => {
  const [list, setList] = useState<any>([]);
 
  useEffect(() => {
    axios.get("/api/list").then((resp) => {
      setList(resp.data);
    });
  }, []);
  
  return (
    <div>
      {list.length > 0 &&
        list.map((item: any, ind: any) => (
          <div key={ind} >
            <dl>
              <dt>
                <p>{item.title}</p>
                <p>{item.city}</p>
                <p>{item.id}</p>
              </dt>
              <dd>{item.xz}K</dd>
            </dl>
          </div>
        ))}
    </div>
  );
};
export default App;
